package com.fromfuture.xuhuidoc.android.utils;

import android.os.Environment;

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Author：何送军
 * creation time：2017/9/14
 **/
public class FileUtils {

    public static File createImageFile() {
        // Create an image file name
        String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
        String imageFileName =timeStamp+ ".jpg";
        String saveDir= Environment.getExternalStorageDirectory()+"/徐汇云医生端图片库";
        // 新建目录
        File dir = new File(saveDir);
        if (!dir.exists())
            dir.mkdir();
        File imageFile= new File(saveDir, imageFileName);
        return imageFile;
    }
    public static File createImageFileOriginal() {
        // Create an image file name
        String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
        String imageFileName =timeStamp+"Original"+ ".jpg";
        String saveDir= Environment.getExternalStorageDirectory()+"/徐汇云医生端图片库";
        // 新建目录
        File dir = new File(saveDir);
        if (!dir.exists())
            dir.mkdir();
        File imageFile= new File(saveDir, imageFileName);
        return imageFile;
    }

}
